home *** CD-ROM | disk | FTP | other *** search
- /*
- driver program for mpw native gcc compiler
-
- Copyright (C) 1990, 1992 Apple Computer, Inc.
-
- Written by:
- Larry Rosenstein
- Brent H. Pease
-
-
- Accepts most MPW C command line arguments and transforms them into gcc arguments.
- Issues warnings for MPW C command arguments that are NOT supported
- Accepts certain GCC C command arguments that do not conflict with MPW C
- */
-
- #include <types.h>
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- #define MAXFILENAME 255
-
- int run_cpp = 1;
- int run_cc1 = 1;
- int run_asm = 1;
- int optimize = 1;
- int quiet_flag = 1;
- int echo_cmds = 0;
- int make_short = 0;
- int got_mc68020 = 0;
- int debug_gcc = 0;
- int overlay_strings = 0;
-
- char* output_filename;
- char* input_filename;
- char* tool_place;
- char* tmp;
-
- char *cpp_options;
- char *cc1_options;
- char *asm_options;
-
- char *tool_suffix = "";
-
- char tmp_filename[MAXFILENAME];
- char cpp_filename[MAXFILENAME];
- char asm_filename[MAXFILENAME];
- char out_filename[MAXFILENAME];
- char *shorten_filename = "•••asm_warnings•••";
- char *shorten_out_filename = "•••asm_modified•••";
-
- /*Handle the sym options notypes, nolines, novars*/
- int HandleSymOpts(char *pOpt) {
- register char *ptr = pOpt;
-
- while(1) {
- /*Check for notypes*/
- if (strncmp(ptr, "notypes", 7) == 0) {
- warn_not_implemented("notypes");
- ptr += 7;
-
- /*Check for nolines*/
- } else if (strncmp(ptr, "nolines", 7) == 0) {
- warn_not_implemented("nolines");
- ptr += 7;
-
- /*Check for novars*/
- } else if (strncmp(ptr, "novars", 6) == 0) {
- warn_not_implemented("novars");
- ptr += 6;
-
- /*Check for must not be a sym option*/
- } else {
- return 0;
- }
- if ((*ptr != ',') || (*ptr == 0)) {
- return 1;
- }
- ptr++;
- }
- }
-
- /*Handle the -opt*/
- void HandleOptOpts(char *pOpt) {
- register char *ptr = pOpt;
-
- while(1) {
- /*Check for off(mpwc)*/
- if (strncmp(ptr, "off", 3) == 0) {
- optimize = 0;
- ptr += 3;
-
- /*Check for on(mpwc)*/
- } else if (strncmp(ptr, "on", 2) == 0) {
- optimize = 1;
- ptr += 2;
-
- /*Check for full(mpwc)*/
- } else if (strncmp(ptr, "full", 4) == 0) {
- optimize = 1;
- make_short = 1;
- ptr += 4;
-
- /*Check for nopeep(mpwc)*/
- } else if (strncmp(ptr, "nopeep", 6) == 0) {
- strcat(cc1_options, " -fno-peephole");
- ptr += 6;
-
- /*Check for nocse(mpwc)*/
- } else if (strncmp(ptr, "nocse", 5) == 0) {
- warn_not_implemented("nocse");
- ptr += 5;
-
- /*Check for high(custom)*/
- } else if (strncmp(ptr, "high", 4) == 0) {
- optimize = 2;
- make_short = 1;
- ptr += 4;
-
- /*Check for branch(custom)*/
- } else if (strncmp(ptr, "branch", 6) == 0) {
- make_short = 1;
- ptr += 6;
-
- /*Unknown option*/
- } else {
- fprintf (stderr, "Warning: unknown option for -opt.\n");
- }
- if ((*ptr != ',') || (*ptr == 0)) {
- return;
- }
- ptr++;
- }
- }
-
- main (argc, argv)
- int argc;
- char* argv[];
- {
- int i, badopt;
- char* arg, *arg1;
- char* missing;
- char* basename;
-
- cpp_options = (char *)malloc(10000);
- cc1_options = (char *)malloc(10000);
- asm_options = (char *)malloc(10000);
- *cpp_options = 0;
- *cc1_options = 0;
- *asm_options = 0;
-
- output_filename = "";
- input_filename = "";
- tool_place = "";
- tmp = ":";
-
- strcpy(cpp_options, "-D__GNUC__=1");
- cc1_options[0] = '\0';
- //strcpy(asm_options, "-w");
-
- for (i=1; i<argc; i++) {
- arg = argv[i];
- badopt = 0;
- missing = "";
-
- if (arg[0] == '-') {
- arg1 = arg;
- switch(arg[1]) {
- case 'a':
- /*Check for -ansi(gcc)*/
- if (strcmp(arg, "-ansi") == 0) {
- strcat(cc1_options, " "); strcat(cc1_options, arg);
-
- /*Check for -asm(custom)*/
- } else if (strcmp(arg, "-asm") == 0) {
- run_asm = 0;
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'b':
- /*Check for -b(mpwc)*/
- if (arg[2] == '\0') {
- strcat(cc1_options, " -mbfun -mbstr");
- } else if ( arg[2] == '2' && arg[3] == '\0' ) {
- strcat(cc1_options, " -mbfun -mbstr");
- overlay_strings = 1;
- } else if ( arg[2] == '3' && arg[3] == '\0' ) {
- strcat(cc1_options, " -mbstr");
- overlay_strings = 1;
- } else if (strcmp(arg, "-bigseg") == 0) {
- warn_not_implemented(arg);
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'c':
- /*Check for -c(mpwc)*/
- if (arg[2] == '\0') {
- run_cc1 = 0;
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'd':
- /*Check for -d string(mpwc)*/
- if (arg[2] == '\0') {
- if (++i<argc) {
- char *savepos = cpp_options+strlen(cpp_options);
- /*transform into gcc command*/
- strcat(cpp_options, " -D"); strcat(cpp_options, argv[i]);
- escape_single_quotes(savepos);
- } else {
- missing = "symbol";
- }
-
- } else {
- /* Probably a debugging option -d<x> - pass thru to cc1 */
- strcat(cc1_options, " "); strcat(cc1_options, arg);
- }
- break;
-
- case 'e':
- /*Check for -e(mpwc)*/
- if (arg[2] == '\0') {
- /*Transform into gcc argument*/
- strcat(cpp_options, " -C");
- run_cc1 = 0;
-
- /*Check for -e2(mpwc)*/
- } else if (arg[2] == '2' && arg[3] == '\0') {
- run_cc1 = 0;
-
- /*Check for -elems881(mpwc)*/
- } else if (strcmp(arg, "-elems881") == 0) {
- strcat(cc1_options, " -melems881");
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'f':
- /*Check for fx(undocumented)*/
- if (arg[2] == 'x' && arg[3] == '\0') {
- /*Make sure there is another option*/
- if (++i>=argc) {
- missing = "number";
-
- /*Check for 30*/
- } else if (strcmp(argv[i], "30") == 0) {
- strcat(cc1_options, " -mfx30");
-
- /*Unknown fx argument*/
- } else {
- fprintf (stderr, "Warning: -fx %s ignored.\n", argv[i]);
- }
-
- /*Check for a whole slew of gcc options*/
- } else if (arg[2] != '\0') {
- /* pass it on to cc1 and let it complain */
- strcat(cc1_options, " ");
- strcat(cc1_options, arg);
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'i':
- /*check for -i pathname(mpwc)*/
- if (arg[2] == '\0') {
- /*Make sure there are more arguments*/
- if (++i<argc) {
- /*Transform into gcc argument*/
- strcat(cpp_options, " -I'");
- strcat(cpp_options, argv[i]);
- strcat(cpp_options, "'");
- } else {
- missing = "directory";
- }
- } else {
- badopt = 1;
- }
- break;
-
- case 'k':
- /* check for -k (MPW C) */
- if (arg[2] == '/0')
- {
- warn_not_implemented(arg);
- if (argv[i+1] != '-') /* directory name to go along with -k */
- i++;
- }
-
- /* check for -kon (equiv to -opt branch) */
- else if (strcmp(arg, "-kon") == 0)
- make_short = 1;
- else
- badopt = 1;
- break;
-
- case 'm':
- /*Check for -m(mpwc)*/
- if (arg[2] == '\0') {
- /*Translate into gcc lingo*/
- strcat(cc1_options, " -mm");
- if (got_mc68020 == 0) {
- /*Make sure the user knows whats up*/
- fprintf (stderr, "Warning: -m forces -mc68020\n");
- strcat(cpp_options, " -Dmc68020");
- strcat(cc1_options, " -m68020");
- got_mc68020 = 1;
- }
-
- /*Check for makedep(custom)*/
- } else if (strcmp(arg, "-makedep") == 0) {
- /*Translate*/
- strcat(cpp_options, " -M");
- run_cc1 = 0;
-
- /*Check for -mbg(mpwc)*/
- } else if (strcmp(arg, "-mbg") == 0) {
- /*Make sure there is another argument*/
- if (++i<argc) {
-
- /*Check for off*/
- if (strcmp(argv[i], "off") == 0) {
- strcat(cc1_options, " -mbgoff -fomit-frame-pointer");
-
- /*Check for full*/
- } else if (strcmp(argv[i], "full") == 0) {
- /*Default*/
-
- /*Check for on*/
- } else if (strcmp(argv[i], "on") == 0) {
- fprintf (stderr, "Warning: -mbg on is not supported, try -mbg full.\n");
-
- /*Unknown option*/
- } else {
- missing = "on|full";
- }
- } else {
- missing = "on|full";
- }
-
- /*Check for -mc68020(mpwc)*/
- } else if (strcmp(arg, "-mc68020") == 0) {
- /*Add in options if needed*/
- if (got_mc68020 == 0) {
- strcat(cpp_options, " -Dmc68020");
- strcat(cc1_options, " -m68020");
- got_mc68020 = 1;
- }
-
- /*Check for -mc68881(mpwc)*/
- } else if (strcmp(arg, "-mc68881") == 0) {
- strcat(cpp_options, " -Dmc68881");
- strcat(cc1_options, " -m68881");
-
- /*Check for -mnoseg(custom)*/
- } else if (strcmp(arg, "-mnoseg") == 0) {
- strcat(cc1_options, " -mnoseg");
-
- /*Check for -model(mpwc)*/
- } else if (strcmp(arg, "-model") == 0) {
- if (++i < argc) {
- /* get the next arg */
- arg = argv[i];
- /*Check for near*/
- if (strcmp(arg, "near") == 0) {
- warn_not_implemented("-model near");
-
- /*Check for far*/
- } else if (strcmp(arg, "far") == 0) {
- warn_not_implemented("-model far");
-
- /*Check for nearData*/
- } else if (strcmp(arg, "nearData") == 0) {
- warn_not_implemented("-model nearData");
-
- /*Check for farData*/
- } else if (strcmp(arg, "farData") == 0) {
- warn_not_implemented("-model farData");
-
- /*Check for nearCode*/
- } else if (strcmp(arg, "nearCode") == 0) {
- warn_not_implemented("-model nearCode");
-
- /*Check for farCode*/
- } else if (strcmp(arg, "farCode") == 0) {
- warn_not_implemented("-model farCode");
-
- /*Unknown options*/
- } else {
- missing = "near|far|nearData|farData|nearCode|farCode";
- }
-
- /*Unknown option*/
- } else {
- missing = "near|far|nearData|farData|nearCode|farCode";
- }
- } else {
- /* pass it on to cc1 and let it analyze */
- strcat(cc1_options, " ");
- strcat(cc1_options, arg);
- }
- break;
-
- case 'n':
- if (!strcmp(arg, "-noext")) {
- tool_suffix = "";
-
- } else if (!strcmp(arg, "-nocpp")) {
- run_cpp = 0;
-
- /*Check for -n(mpwc)*/
- } else if (arg[2] == '\0') {
- /* This is the default for GCC, so can ignore. */
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'o':
- /*Check for -opt(mpwc)*/
- if (strcmp(arg, "-opt") == 0) {
- /*Make sure we have enough arguments left*/
- if (++i<argc) {
- HandleOptOpts(argv[i]);
-
- /*Not enough arguments*/
- } else {
- missing = "on|off|full";
- }
-
- /*Check for -o objname(mpwc)*/
- } else if (arg[2] == '\0') {
- /*Make sure we have enough arguments*/
- if (++i<argc) {
- output_filename = argv[i];
-
- /*Not enough arguments*/
- } else {
- missing = "output filename";
- }
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'p':
- /*Check for -p(mpwc)*/
- if (arg[2] == '\0') {
- /*Translate into gcc args*/
- strcat(cpp_options, " -v");
- strcat(cc1_options, " -version");
- quiet_flag = 0;
- strcat(asm_options, " -p");
- echo_cmds = 1;
-
- /*Check for -pedantic(gcc)*/
- } else if (strcmp(arg, "-pedantic") == 0) {
- strcat(cpp_options, " -pedantic");
- strcat(cc1_options, " -pedantic");
-
- /*Unkown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'r':
- /*Check for -r(mpwc)*/
- if (arg[2] == '\0') {
- strcat(cc1_options, " -Wimplicit");
-
- /*Unkown*/
- } else {
- badopt = 1;
- }
- break;
-
- case 's':
- /*check for -s segment(mpwc)*/
- if (arg[2] == '\0') {
- /*Make sure we have enough options*/
- if (++i<argc) {
- strcat(cc1_options, " -s '");
- strcat(cc1_options, argv[i]);
- strcat(cc1_options, "'");
- } else {
- missing = "segment name";
- }
- }
-
- /*Check for -sym(mpwc)*/
- else if (strcmp(arg, "-sym") == 0) {
- /*Make sure we have enough args*/
- if (++i<argc) {
- if ((strcmp(argv[i], "full") == 0) || (strcmp(argv[i], "on") == 0)) {
- if (HandleSymOpts(argv[i+1])) {
- i++;
- }
- strcat(asm_options, " -sym "); strcat(asm_options, argv[i]);
- fprintf (stderr, "Warning: symbolic info will be produced by assembler.\n");
- } else if (strcmp(argv[i], "off") == 0) {
- /*default*/
- } else {
- missing = "on|off|full";
- }
- } else {
- missing = "option";
- }
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 't':
- /*Check for -t(mpwc)*/
- if (arg[2] == '\0') {
- quiet_flag = 0;
- strcat(asm_options, " -t");
-
- /*Check for -traditional(gcc)*/
- } else if (strcmp(arg, "-traditional") == 0) {
- strcat(cpp_options, " -traditional");
- strcat(cc1_options, " -traditional");
-
- /*Check for tools(custom)*/
- } else if (strcmp(arg, "-tools") == 0) {
- /*Make sure there are enough args*/
- if (++i<argc) {
- tool_place = argv[i];
- } else {
- missing = "directory";
- }
-
- /*Check for -trace(mpwc)*/
- } else if (strcmp(arg, "-trace") == 0) {
- /*Make sure there are enough args*/
- if (++i<argc) {
- /*Check for on*/
- if (strcmp(argv[i], "on") == 0) {
- strcat(cc1_options, " -trace on");
-
- /*Check for off*/
- } else if (strcmp(argv[i], "off") == 0) {
- strcat(cc1_options, " -trace off");
-
- /*Check for always*/
- } else if (strcmp(argv[i], "always") == 0) {
- strcat(cc1_options, " -trace always");
-
- /*Check for never*/
- } else if (strcmp(argv[i], "never") == 0) {
- strcat(cc1_options, " -trace never");
-
- /*Unknown option*/
- } else {
- missing = "on|off|always|never";
- }
-
- /*Unknown option*/
- } else {
- missing = "on|off|always|never";
- }
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'u':
- /*check for -u(mpwc)*/
- if (arg[2] == '\0') {
- /*Make sure there are enough args*/
- if (++i<argc) {
- /*Translate into gcc*/
- strcat(cpp_options, " -U"); strcat(cpp_options, argv[i]);
-
- /*Not enough args*/
- } else {
- missing = "symbol";
- }
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'w':
- /*Check for -w(mpwc)*/
- if (arg[2] == '\0') {
- strcat(cc1_options, " -w");
-
- /*Check for -w2(mpwc)*/
- } else if (arg[2] == '2' && arg[3] == '\0') {
- strcat(cc1_options, " -Wall");
-
- /*Check for -warnings(mpwc)*/
- } else if (strcmp(arg, "-warnings") == 0) {
- /*Make sure there are enough args*/
- if (++i<argc) {
-
- /*Check for on*/
- if (strcmp(argv[i], "on") == 0) {
- strcat(cc1_options, " -Wall");
-
- /*Check for full*/
- } else if (strcmp(argv[i], "full") == 0) {
- strcat(cc1_options, " -Wall");
-
- /*Check for off*/
- } else if (strcmp(argv[i], "off") == 0) {
- strcat(cc1_options, " -w");
-
- /*Unknown option*/
- } else {
- missing = "on|off|full";
- }
-
- /*Unknown option*/
- } else {
- missing = "on|off|full";
- }
-
- /*Unknown option*/
- } else {
- badopt = 1;
- }
- break;
-
- case 'W':
- /*Check for -W(gcc)*/
- if (arg[2] == '\0') {
- strcat(cc1_options, " -W");
-
- /*Check for -Wall(gcc)*/
- } else if (strcmp(arg, "-Wall") == 0) {
- strcat(cc1_options, " -Wall");
-
- /*Check for a slew of gcc options*/
- } else if (arg[2] != '\0') {
- /* pass it to cc1 and let it complain */
- strcat(cc1_options, " "); strcat(cc1_options, arg);
- } else {
- badopt = 1;
- }
- break;
-
- case 'y':
- /*Check for -y(mpwc)*/
- if (arg[2] == '\0') {
- if (++i<argc) {
- tmp = arg;
- } else {
- missing = "directory";
- }
- } else {
- badopt = 1;
- }
- break;
-
- default:
- badopt = 1;
- }
-
- if (missing[0] != '\0') {
- fprintf (stderr, "Warning: missing %s after \"%s\".\n", missing, arg1);
- } else if (badopt) {
- fprintf (stderr, "Warning: invalid option %s ignored.\n", arg);
- }
-
- /*Check for filename*/
- } else if (input_filename[0] == '\0') {
- input_filename = arg;
-
- /*Extra file names is a no no*/
- } else {
- fprintf (stderr, "Warning: extra input filename %s ignored.\n", arg);
- }
- }
-
- /*Not enough filenames is a no no*/
- if (input_filename[0] == '\0') {
- fprintf (stderr, "Error: no input filename.\n");
- exit(2);
- }
-
- strcpy(tmp_filename, tmp);
- if ( (basename = strrchr(input_filename, ':')) != NULL)
- ++basename;
- else
- basename = input_filename;
- strcat(tmp_filename, basename);
-
- if (run_cc1) {
- strcpy(cpp_filename, tmp_filename);
- strcat(cpp_filename, "._");
- }
-
- strcpy(asm_filename, tmp_filename);
- strcat(asm_filename, ".a");
-
- if (output_filename[0] == '\0') {
- strcpy(out_filename, input_filename);
- strcat(out_filename, ".o");
- output_filename = out_filename;
- }
- else if (output_filename[strlen(output_filename)-1] == ':') { // it's a directory, copy basename so we get .c.o
- strcpy(out_filename, output_filename); // not .c.a.o
- strcat(out_filename, basename);
- strcat(out_filename, ".o");
- output_filename = out_filename;
- }
-
- if (quiet_flag)
- strcat(cc1_options, " -quiet");
-
- if (optimize)
- strcat(cc1_options, " -O");
- else if (optimize >= 2)
- strcat(cc1_options, " -O2");
-
- printf ("set oldexit {exit}\n");
- printf ("set exit 0\n");
-
- if (run_cpp) {
- if (echo_cmds)
- printf ("\techo \"'%s'cpp%s %s '%s' '%s'\"\n", tool_place, tool_suffix, cpp_options, input_filename, cpp_filename);
- printf ( "'%s'cpp%s %s '%s' '%s'\n", tool_place, tool_suffix, cpp_options, input_filename, cpp_filename);
- printf ("if {status} == 0\n");
- }
-
- if (run_cc1) {
- if (echo_cmds)
- printf ("\techo \"'%s'cc1%s %s '%s' -o '%s' -dumpbase '%s'\"\n", tool_place, tool_suffix, cc1_options, cpp_filename, asm_filename, tmp_filename);
- printf ( "\t'%s'cc1%s %s '%s' -o '%s' -dumpbase '%s'\n", tool_place, tool_suffix, cc1_options, cpp_filename, asm_filename, tmp_filename);
- printf ("\tif {status} == 0\n");
- if (!debug_gcc && run_cpp) {
- printf ("\t\tdelete -i -y '%s'\n", cpp_filename);
- }
-
- if (run_asm) {
- if (make_short) {
- if (echo_cmds)
- printf ("\t\techo \"asm %s '%s' -o '%s' ∑ '%s'\"\n", asm_options, asm_filename, output_filename, shorten_filename);
- printf ("\t\techo -n > '%s'\n", shorten_filename);
- printf ( "\t\tasm %s '%s' -o '%s' ∑ '%s'\n", asm_options, asm_filename, output_filename, shorten_filename);
- printf ("\t\tloop\n");
- if (echo_cmds)
- printf ("\t\t\techo \"Search -sf /•### Warning 210/ '%s' >> dev:null\"\n", shorten_filename);
- printf ( "\t\t\tSearch -sf /•### Warning 210/ '%s' >> dev:null\n", shorten_filename);
- printf ("\t\t\tif {status} == 0\n");
- if (echo_cmds)
- printf ("\t\t\t\techo \"'%s'shorten -a '%s' -e '%s' -o '%s'\"\n", tool_place, asm_filename, shorten_filename, shorten_out_filename);
- printf ( "\t\t\t\t'%s'shorten -a '%s' -e '%s' -o '%s'\n", tool_place, asm_filename, shorten_filename, shorten_out_filename);
- if (echo_cmds)
- printf ("\t\t\t\techo \"move -y '%s' '%s'\"\n", shorten_out_filename, asm_filename);
- printf ( "\t\t\t\tmove -y '%s' '%s'\n", shorten_out_filename, asm_filename);
- if (echo_cmds)
- printf ("\t\t\t\techo \"asm %s '%s' -o '%s' ∑ '%s'\"\n", asm_options, asm_filename, output_filename, shorten_filename);
- printf ( "\t\t\t\tasm %s '%s' -o '%s' ∑ '%s'\n", asm_options, asm_filename, output_filename, shorten_filename);
- printf ("\t\t\telse\n");
- if (!debug_gcc)
- {
- printf ("\t\t\t\tdelete -i -y '%s'\n", shorten_filename);
- printf ("\t\t\t\tdelete -i -y '%s'\n", shorten_out_filename);
- }
- printf ("\t\t\t\tbreak\n");
- printf ("\t\t\tend\n");
- printf ("\t\tend\n");
- }
- else
- {
- if (echo_cmds)
- printf ("\t\techo \"asm -w %s '%s' -o '%s'\"\n", asm_options, asm_filename, output_filename);
- printf ( "\t\tasm -w %s '%s' -o '%s'\n", asm_options, asm_filename, output_filename);
- }
- printf ("\t\tif {status} == 0\n");
- if (!debug_gcc)
- printf ("\t\t\tdelete -i -y '%s'\n", asm_filename);
- printf ("\t\telse\n");
- printf ("\t\t\tset exit {oldexit}\n");
- printf ("\t\t\texit 2\n");
- printf ("\t\tend\n");
- }
- printf ("\telse\n");
- if (!debug_gcc) {
- if (run_cpp)
- printf ("\t\tdelete -i -y '%s'\n", cpp_filename);
- printf ("\t\tdelete -i -y '%s'\n", asm_filename);
- }
- printf ("\t\tset exit {oldexit}\n");
- printf ("\t\texit 2\n");
- printf ("\tend\n");
-
- }
- printf ("else\n");
- if (!debug_gcc) {
- printf ("\tdelete -i -y '%s'\n", cpp_filename);
- }
- printf ("\tset exit {oldexit}\n");
- printf ("\texit 2\n");
- printf ("end\n");
-
- /* if (echo_cmds)*/
- /* printf ("set echo {oldecho}\n");*/
- printf ("set exit {oldexit}\n");
-
- exit(0);
- }
-
- warn_not_implemented(arg)
- char *arg;
- {
- fprintf (stderr, "Warning: %s ignored, not implemented yet.\n", arg);
- }
-
- escape_single_quotes(buf)
- char *buf;
- {
- int i, j;
-
- for (i = 0; buf[i] != '\0'; ++i) {
- if (buf[i] == '\'') {
- buf[strlen(buf)+1] = '\0';
- for (j = strlen(buf)+1; j > i; --j) {
- buf[j] = buf[j-1];
- }
- buf[i++] = '∂';
- }
- }
- }
-